"""
BitmapButton
============

As demonstrated in this example, you can use the bitmaps included with
wxWidgets as the bitmap labels for `BitmapButton`.
"""
from wxpita import *

f = SizedFrame [
    BitmapButton(name='btn1'),
    BitmapButton(name='btn2'),
    BitmapButton(name='btn3'),

    TextCtrl(name='log', style='te_multiline', expand=True, size=(300,250)),
]

@f.Init
def _():
    def bm(artid):
        return  wx.ArtProvider.GetBitmap(artid, wx.ART_OTHER, (32,32))

    f.btn1.SetBitmapLabel(bm(wx.ART_ERROR))

    f.btn2.SetBitmapLabel(bm(wx.ART_WARNING))

    f.btn3.SetBitmapLabel(bm(wx.ART_TIP))

@f.btn1.button_clicked
@f.btn2.button_clicked
@f.btn3.button_clicked
def _(evt):
    f.log.AppendText('You clicked on %s\n' % evt.EventObject.GetName())

f.Show('BitmapButton Example', size='fit')
